Resource URL: /platform/<<version=4>>/network/groupnets/<GROUPNET>/subnets

    Overview: This resource exposes OneFS network subnets.

     Methods: GET, POST

********************************************************************************

Method GET: Get a list of subnets.

       URL: GET /platform/<<version=4>>/network/groupnets/<GROUPNET>/subnets

Query arguments:
  sort=<string> The field that will be used for sorting.
limit=<integer> Return no more than this many results at once (see resume).
     dir=<enum> Where <enum> is one of ASC, DESC.  The direction of the sort.
resume=<string> Continue returning results from previous call using this token
                (token should come from the previous call, resume cannot be
                used with other options).

GET response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "additionalProperties": false, 
      "type": "object", 
      "properties": {
        "subnets": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "properties": {
              "prefixlen": {
                "minimum": 1, 
                "type": "integer", 
                "description": "Subnet Prefix Length.", 
                "maximum": 128
              }, 
              "mtu": {
                "minimum": 576, 
                "type": "integer", 
                "description": "MTU of the subnet.", 
                "maximum": 9000
              }, 
              "description": {
                "type": "string", 
                "description": "A description of the subnet.", 
                "maxLength": 128
              }, 
              "base_addr": {
                "type": "string", 
                "description": "The base IP address."
              }, 
              "gateway_priority": {
                "minimum": 1, 
                "type": "integer", 
                "description": "Gateway priority.", 
                "maximum": 2147483647
              }, 
              "vlan_enabled": {
                "type": "boolean", 
                "description": "VLAN tagging enabled or disabled."
              }, 
              "sc_service_name": {
                "type": "string", 
                "description:": "Domain Name corresponding to the SmartConnect Service Address."
              }, 
              "dsr_addrs": {
                "items": {
                  "type": "string"
                }, 
                "type": "array", 
                "description": "List of Direct Server Return addresses."
              }, 
              "pools": {
                "items": {
                  "type": "string"
                }, 
                "type": "array", 
                "description": "Name of the pools in the subnet."
              }, 
              "sc_service_addr": {
                "type": "string", 
                "description": "The address that SmartConnect listens for DNS requests."
              }, 
              "id": {
                "type": "string", 
                "description": "Unique Subnet ID."
              }, 
              "groupnet": {
                "type": "string", 
                "description": "Name of the groupnet this subnet belongs to."
              }, 
              "addr_family": {
                "enum": [
                  "ipv4", 
                  "ipv6"
                ], 
                "type": "string", 
                "description": "IP address format."
              }, 
              "gateway": {
                "type": "string", 
                "description": "Gateway IP address."
              }, 
              "vlan_id": {
                "minimum": 2, 
                "type": "integer", 
                "description": "VLAN ID for all interfaces in the subnet.", 
                "maximum": 4094
              }, 
              "name": {
                "type": "string", 
                "description": "The name of the subnet.", 
                "maxLength": 32
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }, 
        "total": {
          "minimum": 0, 
          "type": "integer", 
          "description": "Total number of items available.", 
          "maximum": 4294967295
        }, 
        "resume": {
          "minLength": 0, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "Continue returning results from previous call using this token (token should come from the previous call, resume cannot be used with other options)."
        }
      }
    }
  ]
}

********************************************************************************

Method POST: Create a new subnet.

        URL: POST /platform/<<version=4>>/network/groupnets/<GROUPNET>/subnets

There are no query arguments for this method.

Required POST request body fields:
addr_family, prefixlen, name

POST request body schema:
{
  "type": "object", 
  "properties": {
    "description": {
      "type": "string", 
      "description": "A description of the subnet.", 
      "maxLength": 128
    }, 
    "gateway_priority": {
      "minimum": 1, 
      "type": "integer", 
      "description": "Gateway priority.", 
      "maximum": 2147483647
    }, 
    "addr_family": {
      "enum": [
        "ipv4", 
        "ipv6"
      ], 
      "type": "string", 
      "description": "IP address format.", 
      "required": true
    }, 
    "sc_service_name": {
      "type": "string", 
      "description:": "Domain Name corresponding to the SmartConnect Service Address."
    }, 
    "mtu": {
      "minimum": 576, 
      "type": "integer", 
      "description": "MTU of the subnet.", 
      "maximum": 9000
    }, 
    "sc_service_addr": {
      "type": "string", 
      "description": "The address that SmartConnect listens for DNS requests."
    }, 
    "vlan_id": {
      "minimum": 2, 
      "type": "integer", 
      "description": "VLAN ID for all interfaces in the subnet.", 
      "maximum": 4094
    }, 
    "prefixlen": {
      "required": true, 
      "minimum": 1, 
      "type": "integer", 
      "description": "Subnet Prefix Length.", 
      "maximum": 128
    }, 
    "dsr_addrs": {
      "items": {
        "type": "string"
      }, 
      "type": "array", 
      "description": "List of Direct Server Return addresses."
    }, 
    "gateway": {
      "type": "string", 
      "description": "Gateway IP address."
    }, 
    "vlan_enabled": {
      "type": "boolean", 
      "description": "VLAN tagging enabled or disabled."
    }, 
    "name": {
      "required": true, 
      "type": "string", 
      "description": "The name of the subnet.", 
      "maxLength": 32
    }
  }
}

POST response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "type": "object", 
      "properties": {
        "id": {
          "minLength": 0, 
          "required": true, 
          "type": "string", 
          "description": "ID of created item that can be used to refer to item in the collection-item resource path.", 
          "maxLength": 255
        }
      }
    }
  ]
}
